﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Rsa
{
	/// <summary>
	/// Interaction logic for Configuracao.xaml
	/// </summary>
	public partial class Configuracao : UserControl
	{
        private GestorConfigXML gxml;
		public Configuracao()
		{
			this.InitializeComponent();
            this.gxml = new GestorConfigXML();
            this.loadEmentaURL();

		}

        private void loadEmentaURL()
        {
            urlEmentaTextBox.Text = gxml.getEmentaURL();
        }

        private void guardarEmail_Click(object sender, RoutedEventArgs e)
        {
            /*
            ImapReader im = new ImapReader();
            im.InitializeConnection("pod51007.outlook.com", 993);
            im.AuthenticateUser("2101101@my.ipleiria.pt", "solsemdia");
            emailUsernameTextbox.Text = im.MailCount().ToString();
             **/

            /*
            // Connect to the IMAP server. The 'true' parameter specifies to use SSL
            // which is important (for Gmail at least)
            ImapClient ic = new ImapClient("imap.gmail.com", "name@gmail.com", "pass",
                            ImapClient.AuthMethods.Login, 993, true);
            // Select a mailbox. Case-insensitive
            ic.SelectMailbox("INBOX");
            Console.WriteLine(ic.GetMessageCount());
            // Get the first *11* messages. 0 is the first message;
            // and it also includes the 10th message, which is really the eleventh ;)
            // MailMessage represents, well, a message in your mailbox
            MailMessage[] mm = ic.GetMessages(0, 10);
            foreach (MailMessage m in mm)
            {
                Console.WriteLine(m.Subject);
            }
            // Probably wiser to use a using statement
            ic.Dispose();
             * */

            
            

        }
	}
}